#ifndef __FASTMOTOR_H_
#define __FASTMOTOR_H_

#include "constants.h"
#ifdef FASTMOTORDRIVER
#include "ChoosableClass.h"
#include "CommandHandler.h"
#include "MotorDriver.h"

enum class FASTMotor_commands : uint32_t
{
    canid,
    canspd,
    uarterrors,
    status,
    torque,
    voltage,
    anticogging,
    connected
};

class FASTMotor : public MotorDriver, public CommandHandler, cpp_freertos::Thread
{
  public:
    FASTMotor();
    static bool            inUse;
    static ClassIdentifier info;
    virtual ~FASTMotor();
    void          turn(int16_t power) override;
    void          stopMotor() override;
    void          startMotor() override;
    bool          motorReady() override; // Returns true if the driver is active and ready to receive commands
    void          registerCommands();
    CommandStatus command(const ParsedCommand &cmd, std::vector<CommandReply> &replies) override;

    const ClassIdentifier getInfo() override { return info; }
    void                  Run() override
    {
        while (true)
        {
            vTaskDelay(10);
        }
    }
};
#endif
#endif